package com.example.gaoyang.controller;

import com.example.gaoyang.domain.request.StationRequest;
import com.example.gaoyang.domain.vo.StationVO;
import com.example.gaoyang.request.Result;
import com.example.gaoyang.service.StationService;
import com.example.gaoyang.util.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/station")
public class StationController {

   @Resource
   private StationService stationService;

   @PostMapping("/getStationList")
   public Result<List<StationVO>> getStationList(@RequestBody StationRequest stationRequest) {
        return ResultUtil.success(stationService.getStationList(stationRequest));
   }

}
